<template>
	<view>
		<mh-navbar :back="true"  title="最新开盒" fixed center zIndex="1010" />
		<view class="box-container">
			<view v-for="(item,index) in newestDay" :key='index' class="box-list">
				<view class="box-good-left">
					<image :src="appUrl + item.img" style="width: 100px;height: 100px;"></image>
					<view class="box-good-price">
						价值：{{item.price}}
					</view>
				</view>
				<view class="box-good-right">
					<view class="box-good-title">
						<text style="color: red;">{{item.userNick}}</text>
						<text style="color: #F0AD4E;">{{item.action}}连击</text>
						<text>获得</text>
						<text>{{item.name}}</text>
					</view>
					<view>开盒时间：{{item.createTime}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				appUrl:this.$store.state.vuex_config.appUrl,
				newestDay:[],
			}
		},
		onLoad(){
			this.getNewestBoxDay();
		},
		methods: {
			getNewestBoxDay(){
				this.$u.api.newestDay().then(res => {
					debugger
					if (res.code == 200){
						this.newestDay = res.data;
					}
				});
			},
		}
	}
</script>

<style lang="scss">
.box-container{
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 20px;
	width: 100%;
	.box-list{
		background: #FFFFFF;
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 100%;
		margin-bottom: 20px;
		.box-good-left{
			width: 30%;
			position:relative;
			display: flex;
			justify-content: center;
			align-items: center;
			.box-good-price{
				position: absolute;
				font-size: 5px;
				bottom: 5px;
				z-index: 1000;
				background: red;
				color: #ffffff;
				padding: 0 5px 0 5px;
				border-radius: 25px;
			}
		}
		.box-good-right{
			width: 70%;
			padding: 0 10px 0 10px;
		}
	}
}
</style>
